Application programs, such as anti-virus and productivity application suites, may be configured to validate files by determining whether a particular file conforms to a specified format when the file is opened on a computer. The file validation process becomes increasingly complicated, however, for file formats which consist of variable-length records such as Binary Interchange File Format (“BIFF”) files. Validating BIFF files requires several operations including: comparing values in contiguous records, comparing values in two different noncontiguous records, validating counts of certain types versus the value in a particular field of another record, determining which record a particular offset falls within and using a value in one record to interpret the content within another record.
Current methods for BIFF file validation require a two-phased analysis of the records in a file. During a first phase, each record's position and type and other key data is stored in memory in an array. The second phase then uses the array as a lookup table to help accomplish validation. The current methods for BIFF file validation, however, suffer from a number of drawbacks. One drawback is that the current methods only work efficiently for small and moderate BIFF files. However, many real world BIFF files have hundreds of millions of records. The validation of larger BIFF files using current methods causes the array to use a large amount of memory which slows down counting and searching operations associated with the array. Another drawback with the current methods is that, in some cases, the memory allocation requirements for validating larger BIFF files is so large, some computer systems may run out of memory before the file validation process is completed. It is with respect to these considerations and others that the various embodiments of the present invention have been made.